<?php

namespace DebugComponent\Message;

abstract class Message implements \DebugComponent\IMessage {

    public function __construct($message) {
        $this->message = (string)$message;
        $parts = explode('\\', get_class($this));
        $this->type = strtolower($parts[count($parts)-1]);
    }

    public function  __toString() {
        return $this->message;
    }

    public function getType() {
        return $this->type;
    }

    protected function getMessage() {
        return $this->message;
    }

    private $message;
    private $type;
}